<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>返回一个包含 dst (夏令时)，时差和时区信息的关联数组。</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="datetimezone.gettransitions.html">« DateTimeZone::getTransitions</a></li>
      <li style="float: right;"><a href="datetimezone.listidentifiers.html">DateTimeZone::listIdentifiers »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.datetimezone.html">DateTimeZone</a></li>
    <li>返回一个包含 dst (夏令时)，时差和时区信息的关联数组。</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="datetimezone.listabbreviations" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DateTimeZone::listAbbreviations</h1>
  <h1 class="refname">timezone_abbreviations_list</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DateTimeZone::listAbbreviations</span> -- <span class="refname">timezone_abbreviations_list</span> &mdash; <span class="dc-title">返回一个包含 dst (夏令时)，时差和时区信息的关联数组。</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-datetimezone.listabbreviations-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>DateTimeZone::listAbbreviations</strong></span>(): <span class="type">array</span></div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><a href="function.timezone-abbreviations-list.html" class="methodname">timezone_abbreviations_list</a></span>(): <span class="type">array</span></div>

  <p class="para rdfs-comment">
   返回简写列表，包含历史上所有使用过的简写，这可能会导致既正确又混乱的条目。也会存在冲突，比如
   <code class="literal">PST</code> 在美国和菲律宾都在有使用。
  </p>
  <p class="para">
   因此函数返回的列表不适合构建为带选项的数组，以便向用户提供时区选择。
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    出于性能考虑，会预先编译此函数的数据。在使用较新的
    <a href="https://pecl.php.net/package/timezonedb" class="link external">&raquo;&nbsp;timezonedb</a> 时不会更新。
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-datetimezone.listabbreviations-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-datetimezone.listabbreviations-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回时区简写数组。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-datetimezone.listabbreviations-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2047">
    <p><strong>示例 #1 <span class="function"><a href="function.timezone-abbreviations-list.html" class="function">timezone_abbreviations_list()</a></span> 函数的范例：</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$timezone_abbreviations&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">DateTimeZone</span><span style="color: #007700">::</span><span style="color: #0000BB">listAbbreviations</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$timezone_abbreviations</span><span style="color: #007700">[</span><span style="color: #DD0000">"acst"</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [0] =&gt; Array
        (
            [dst] =&gt; 1
            [offset] =&gt; -14400
            [timezone_id] =&gt; America/Porto_Acre
        )

    [1] =&gt; Array
        (
            [dst] =&gt; 1
            [offset] =&gt; -14400
            [timezone_id] =&gt; America/Eirunepe
        )

    [2] =&gt; Array
        (
            [dst] =&gt; 1
            [offset] =&gt; -14400
            [timezone_id] =&gt; America/Rio_Branco
        )

    [3] =&gt; Array
        (
            [dst] =&gt; 1
            [offset] =&gt; -14400
            [timezone_id] =&gt; Brazil/Acre
        )

)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-datetimezone.listabbreviations-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.timezone-identifiers-list.html" class="function" rel="rdfs-seeAlso">timezone_identifiers_list()</a> - 别名 DateTimeZone::listIdentifiers</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>